<template>
  <section class="page">
    <headerbar>区县选择</headerbar>
    <section>

    </section>

      <!--支部成员-->
      <section class="d-scroll mgt-2">
        <section class="people-list ">
          <div @click="select(item)" v-for="item in durationList" class="people-item block noborder">
            <section class="people-info">
              <div class="avatar-img" v-if="false">
                <img src="../../../../static/images/default.jpg" alt="">
              </div>
              <span class="name">{{item.content}}</span>
            </section>
          </div>

        <p class="pdv-5"></p>
        <p class="pdv-5"></p>
        </section>
      </section>

  </section>
</template>


<script>
  import _ from 'lodash'
  import tools from '@/utils/tools'
  export default {
    name: 'personnelSelection',
    data () {
      return {
        list: [],
        durationList: []
      }
    },
    created () {
      this.loadDuration()
    },
    methods: {
      loadDuration () {
        this.durationList = []
        let data = {
          params: {},
          rankLevel: '2'
        }
        this.fetchService.queryList(data).then((res) => {
          if (res.code === 0) {
            res.data.map((v, i) => {
              let data = {
                scope: v.groupId,
                content: v.name
              }
              this.durationList.push(data)
            })
          }
        })
      },
      select (item) {
        this.$store.state.tutoringVillageAdd.areaListLabel = item.content
        this.$store.state.tutoringVillageAdd.areaList = item.scope
        tools.back()
      }
    }
  }
</script>

<style scoped>

</style>
